#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 100001;

int n,m,m2;
LL arr[N];
LL brr[N];
LL c[N][15],q[N][15],_d[N][15],_e[N][15];
LL minn[N][15],maxn[N][15];
int l1,r1,l2,r2;

inline LL querymaxn(const LL maxn[][15],int l,int r){
    if(l==r) return maxn[l][0];
    int x = (int)log2(r-l);
    return max(maxn[l][x],maxn[r-(1<<x)+1][x]);
}
inline LL queryminn(const LL minn[][15],int l,int r){
    if(l==r) return minn[l][0];
    int x = (int)log2(r-l);
    return min(minn[l][x],minn[r-(1<<x)+1][x]);
}


int main(){
    scanf("%d%d%d",&n,&m,&m2);
    memset(_e,0,sizeof(_e)); memset(_d,0x81,sizeof(_d));
    memset(c,0x7f,sizeof(c)); memset(q,0,sizeof(q));
    for(int i=1;i<=n;i++){
        scanf("%lld",&arr[i]);
        if(arr[i]>0){
            c[i][0] = q[i][0] = arr[i];
        }
        else if(arr[i]<0){
            _d[i][0] = _e[i][0] = arr[i]; 
        }
        else{
            c[i][0] = _d[i][0] = 0;
        }
    }
    for(int len = 1;len<=(int)log2(n);len++){
        for(int i=1;i<=n;i++){
            q[i][len] = max(q[i][len-1],q[min(n,i+(1<<(len-1)))][len-1]);
            _d[i][len] = max(_d[i][len-1],_d[min(n,i+(1<<(len-1)))][len-1]);
            _e[i][len] = min(_e[i][len-1],_e[min(n,i+(1<<(len-1)))][len-1]);
            c[i][len] = min(c[i][len-1],c[min(n,i+(1<<(len-1)))][len-1]);
        }
    }
    for(int i=1;i<=m;i++){
        scanf("%lld",&brr[i]);
        minn[i][0] = maxn[i][0] = brr[i];
    }
    for(int len = 1;len<=(int)log2(m);len++){
        for(int i=1;i<=m;i++){
            maxn[i][len] = max(maxn[i][len-1],maxn[min(m,i+(1<<(len-1)))][len-1]);
            minn[i][len] = min(minn[i][len-1],minn[min(m,i+(1<<(len-1)))][len-1]);
        }
    }

    // for(int len = 0;len<=(int)log2(n);len++){
    //     for(int i=1;i<=n;i++){
    //         cout<<c[i][len]<<' ';
    //     }
    //     cout<<"\n";
    // }
    // for(int len = 0;len<=(int)log2(n);len++){
    //     for(int i=1;i<=n;i++){
    //         cout<<_d[i][len]<<' ';
    //     }
    //     cout<<"\n";
    // }

    // for(int len = 0;len<=(int)log2(m);len++){
    //     for(int i=1;i<=m;i++){
    //         cout<<maxn[i][len]<<' ';
    //     }
    //     cout<<"\n";
    // }
    // for(int len = 0;len<=(int)log2(m);len++){
    //     for(int i=1;i<=m;i++){
    //         cout<<minn[i][len]<<' ';
    //     }
    //     cout<<"\n";
    // }

    int ty1,ty2;
    for(int i=1;i<=m2;i++){
        scanf("%d%d%d%d",&l1,&r1,&l2,&r2);
        LL max2 = querymaxn(maxn,l2,r2);
        LL min2 = queryminn(minn,l2,r2);
        if(max2<=0) ty2=0;
        else if(min2>=0) ty2=1;
        else ty2=2;

        LL maxd = querymaxn(_d,l1,r1);
        LL minc = queryminn(c,l1,r1);
        LL maxq = querymaxn(q,l1,r1);
        LL mine = queryminn(_e,l1,r1);
        if(maxq==0) ty1=0;
        else if(mine==0) ty1=1;
        else ty1=2;

        if(ty1==0){
            if(ty2==0) printf("%lld",max2*mine);
            else if(ty2==1) printf("%lld",max2*maxd);
            else printf("%lld",max2*maxd);
        }
        else if(ty1==1){
            if(ty2==0) printf("%lld",min2*minc);
            else if(ty2==1) printf("%lld",min2*maxq);
            else printf("%lld",min2*minc);
        }
        else if(ty1==2){
            if(ty2==0) printf("%lld",max2*mine);
            else if(ty2==1) printf("%lld",min2*maxq);
            else printf("%lld",max(minc*min2,max2*maxd));
        }
        printf("\n");
    }
    return 0;
}